------------------------------------------------------------------------------
--                                                                          --
--                  CairoAda - Ada95 binding for Cairo                      --
--                                                                          --
-- Copyright (C) 2006-2009, Damien Carbonne                                 --
--                                                                          --
-- This library is free software; you can redistribute it and/or modify it  --
-- under the terms of the GNU General Public License as published by the    --
-- Free Software Foundation; either version 2 of the License, or (at your   --
-- option) any later version.                                               --
--                                                                          --
-- This library is distributed in the hope that it will be useful,          --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of           --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details.                                         --
--                                                                          --
-- You should have received a copy of the GNU General Public License along  --
-- with this library; if not, write to the Free Software Foundation,        --
-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.           --
--                                                                          --
-- As a special exception, if other files instantiate generics from this    --
-- unit, or you link this unit with other files to produce an executable,   --
-- this unit does not by itself cause the resulting executable to be        --
-- covered by the GNU General Public License. This exception does not       --
-- however invalidate any other reasons why the executable file might be    --
-- covered by the GNU Public License.                                       --
------------------------------------------------------------------------------

with Cairo.Support.FT; use Cairo.Support.FT;

package body Cairo.Font_Face.FT is

   -------------------
   -- New_Font_Face --
   -------------------

   function New_Font_Face (
      Face : FT_Face;
      Load_Flags : FT_Load_Flags := 0
      ) return Cairo_Font_Face_Handle
   is
      p : Font_Face_Ptr := cairo_ft_font_face_create_for_ft_face (Face, Load_Flags);
   begin
      return To_Handle(Ptr => p, Is_Referenced => True);
   end New_Font_Face;

   ---------------
   -- Lock_Face --
   ---------------

   procedure Lock_Face (
      Scaled_Font : in out Cairo_Scaled_Font'Class;
      Face : out FT_Face
      )
   is
   begin
      Face := cairo_ft_scaled_font_lock_face (Ptr (Scaled_Font));
   end Lock_Face;

   -----------------
   -- Unlock_Face --
   -----------------

   procedure Unlock_Face (Scaled_Font : in out Cairo_Scaled_Font'Class)
   is
   begin
      cairo_ft_scaled_font_unlock_face (Ptr (Scaled_Font));
   end Unlock_Face;


end Cairo.Font_Face.FT;
